﻿@using Rehabilitation.Models
@model Rehabilitation.Models.Test

@{
    ViewBag.Title = "Create";
}



<h2>Create</h2>

@using (Html.BeginForm())
{
    Patient patient = ViewBag.Patient;
    
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Test</legend>


        <div class="hide">
            @Html.Hidden("PatientID",patient.PatientID)
        </div>


        <div class="hide">
            @Html.Hidden("UserID", ((Guid)ViewBag.UserID).ToString())
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TestDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TestDate)
            @Html.ValidationMessageFor(model => model.TestDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Location)
        </div>
        <div class="editor-field">
            @Html.DropDownList("Location", (List<SelectListItem>)ViewBag.LocationList)
        </div>


        <div class="hide">
            @Html.EditorFor(model => model.PreTest)
            @Html.ValidationMessageFor(model => model.PreTest)
        </div>


        <div class="hide">
            @Html.EditorFor(model => model.PostTest)
            @Html.ValidationMessageFor(model => model.PostTest)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
    <script>
        $(document).ready(function () {
            $("#TestDate").datepicker();
        });
        
    </script>
}
